namespace GeoWeb.Demo.WorkDataConfig
{
    using System;
    using GeoWeb.DataContext;


    /// <summary>
    /// 表名：GeoWorkTime 主键列：
    /// </summary>
    [SerializableAttribute()]
    public partial class GeoWorkTime : Entity
    {

        protected Int32 _ID;

        protected Int32? _ClassID;

        protected DateTime? _Start_Date;

        protected DateTime? _End_Date;

        protected DateTime? _AmStartTime;

        protected DateTime? _AmEndTime;

        protected DateTime? _PmStartTime;

        protected DateTime? _PmEndTime;

        public Int32 ID
        {
            get
            {
                return this._ID;
            }
            set
            {
                this.OnPropertyValueChange(_.ID, _ID, value);
                this._ID = value;
            }
        }

        public Int32? ClassID
        {
            get
            {
                return this._ClassID;
            }
            set
            {
                this.OnPropertyValueChange(_.ClassID, _ClassID, value);
                this._ClassID = value;
            }
        }

        public DateTime? Start_Date
        {
            get
            {
                return this._Start_Date;
            }
            set
            {
                this.OnPropertyValueChange(_.Start_Date, _Start_Date, value);
                this._Start_Date = value;
            }
        }

        public DateTime? End_Date
        {
            get
            {
                return this._End_Date;
            }
            set
            {
                this.OnPropertyValueChange(_.End_Date, _End_Date, value);
                this._End_Date = value;
            }
        }

        public DateTime? AmStartTime
        {
            get
            {
                return this._AmStartTime;
            }
            set
            {
                this.OnPropertyValueChange(_.AmStartTime, _AmStartTime, value);
                this._AmStartTime = value;
            }
        }

        public DateTime? AmEndTime
        {
            get
            {
                return this._AmEndTime;
            }
            set
            {
                this.OnPropertyValueChange(_.AmEndTime, _AmEndTime, value);
                this._AmEndTime = value;
            }
        }

        public DateTime? PmStartTime
        {
            get
            {
                return this._PmStartTime;
            }
            set
            {
                this.OnPropertyValueChange(_.PmStartTime, _PmStartTime, value);
                this._PmStartTime = value;
            }
        }

        public DateTime? PmEndTime
        {
            get
            {
                return this._PmEndTime;
            }
            set
            {
                this.OnPropertyValueChange(_.PmEndTime, _PmEndTime, value);
                this._PmEndTime = value;
            }
        }

        /// <summary>
        /// 获取实体对应的表名
        /// </summary>
        protected override Table GetTable()
        {
            return new Table<GeoWorkTime>("GeoWorkTime");
        }

        /// <summary>
        /// 获取实体中的标识列
        /// </summary>
        protected override Field GetIdentityField()
        {
            return _.ID;
        }

        /// <summary>
        /// 获取列信息
        /// </summary>
        protected override Field[] GetFields()
        {
            return new Field[] {
                        _.ID,
                        _.ClassID,
                        _.Start_Date,
                        _.End_Date,
                        _.AmStartTime,
                        _.AmEndTime,
                        _.PmStartTime,
                        _.PmEndTime};
        }

        /// <summary>
        /// 获取列数据
        /// </summary>
        protected override object[] GetValues()
        {
            return new object[] {
                        this._ID,
                        this._ClassID,
                        this._Start_Date,
                        this._End_Date,
                        this._AmStartTime,
                        this._AmEndTime,
                        this._PmStartTime,
                        this._PmEndTime};
        }

        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        protected override void SetValues(IRowReader reader)
        {
            if ((false == reader.IsDBNull(_.ID)))
            {
                this._ID = reader.GetInt32(_.ID);
            }
            if ((false == reader.IsDBNull(_.ClassID)))
            {
                this._ClassID = reader.GetInt32(_.ClassID);
            }
            if ((false == reader.IsDBNull(_.Start_Date)))
            {
                this._Start_Date = reader.GetDateTime(_.Start_Date);
            }
            if ((false == reader.IsDBNull(_.End_Date)))
            {
                this._End_Date = reader.GetDateTime(_.End_Date);
            }
            if ((false == reader.IsDBNull(_.AmStartTime)))
            {
                this._AmStartTime = reader.GetDateTime(_.AmStartTime);
            }
            if ((false == reader.IsDBNull(_.AmEndTime)))
            {
                this._AmEndTime = reader.GetDateTime(_.AmEndTime);
            }
            if ((false == reader.IsDBNull(_.PmStartTime)))
            {
                this._PmStartTime = reader.GetDateTime(_.PmStartTime);
            }
            if ((false == reader.IsDBNull(_.PmEndTime)))
            {
                this._PmEndTime = reader.GetDateTime(_.PmEndTime);
            }
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if ((obj == null))
            {
                return false;
            }
            if ((false == typeof(GeoWorkTime).IsAssignableFrom(obj.GetType())))
            {
                return false;
            }
            if ((((object)(this)) == ((object)(obj))))
            {
                return true;
            }
            return false;
        }

        public class _
        {

            /// <summary>
            /// 表示选择所有列，与*等同
            /// </summary>
            public static AllField All = new AllField<GeoWorkTime>();

            /// <summary>
            /// 字段名：ID - 数据类型：Int32
            /// </summary>
            public static Field ID = new Field<GeoWorkTime>("ID");

            /// <summary>
            /// 字段名：ClassID - 数据类型：Nullable`1
            /// </summary>
            public static Field ClassID = new Field<GeoWorkTime>("ClassID");

            /// <summary>
            /// 字段名：Start_Date - 数据类型：Nullable`1
            /// </summary>
            public static Field Start_Date = new Field<GeoWorkTime>("Start_Date");

            /// <summary>
            /// 字段名：End_Date - 数据类型：Nullable`1
            /// </summary>
            public static Field End_Date = new Field<GeoWorkTime>("End_Date");

            /// <summary>
            /// 字段名：AmStartTime - 数据类型：Nullable`1
            /// </summary>
            public static Field AmStartTime = new Field<GeoWorkTime>("AmStartTime");

            /// <summary>
            /// 字段名：AmEndTime - 数据类型：Nullable`1
            /// </summary>
            public static Field AmEndTime = new Field<GeoWorkTime>("AmEndTime");

            /// <summary>
            /// 字段名：PmStartTime - 数据类型：Nullable`1
            /// </summary>
            public static Field PmStartTime = new Field<GeoWorkTime>("PmStartTime");

            /// <summary>
            /// 字段名：PmEndTime - 数据类型：Nullable`1
            /// </summary>
            public static Field PmEndTime = new Field<GeoWorkTime>("PmEndTime");
        }
    }
}
